<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: Graph API: Image Feature Detection</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Graph API: Image Feature Detection<div class="ingroups"><a class="el" href="../../d2/d00/group__gapi__imgproc.html">G-API Image processing functionality</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad93b9f85e6abecc152d05d3e75bac37a"><td align="right" class="memItemLeft" valign="top"><a class="el" href="../../df/daa/classcv_1_1GMat.html">GMat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/def/group__gapi__feature.html#gad93b9f85e6abecc152d05d3e75bac37a">cv::gapi::Canny</a> (const <a class="el" href="../../df/daa/classcv_1_1GMat.html">GMat</a> &amp;image, double threshold1, double threshold2, int apertureSize=3, bool L2gradient=false)</td></tr>
<tr class="memdesc:gad93b9f85e6abecc152d05d3e75bac37a"><td class="mdescLeft"> </td><td class="mdescRight">Finds edges in an image using the Canny algorithm.  <a href="../../d5/def/group__gapi__feature.html#gad93b9f85e6abecc152d05d3e75bac37a">More...</a><br/></td></tr>
<tr class="separator:gad93b9f85e6abecc152d05d3e75bac37a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaae597c644d9cbf4b76a880e2749be223"><td align="right" class="memItemLeft" valign="top"><a class="el" href="../../d3/d44/classcv_1_1GArray.html">GArray</a>&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga7d080aa40de011e4410bca63385ffe2a">Point2f</a> &gt; </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/def/group__gapi__feature.html#gaae597c644d9cbf4b76a880e2749be223">cv::gapi::goodFeaturesToTrack</a> (const <a class="el" href="../../df/daa/classcv_1_1GMat.html">GMat</a> &amp;image, int maxCorners, double qualityLevel, double minDistance, const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;<a class="el" href="../../da/dd3/group__gapi__math.html#gaba076d51941328cb7ca9348b7b535220">mask</a>=<a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a>(), int blockSize=3, bool useHarrisDetector=false, double k=0.04)</td></tr>
<tr class="memdesc:gaae597c644d9cbf4b76a880e2749be223"><td class="mdescLeft"> </td><td class="mdescRight">Determines strong corners on an image.  <a href="../../d5/def/group__gapi__feature.html#gaae597c644d9cbf4b76a880e2749be223">More...</a><br/></td></tr>
<tr class="separator:gaae597c644d9cbf4b76a880e2749be223"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="gad93b9f85e6abecc152d05d3e75bac37a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad93b9f85e6abecc152d05d3e75bac37a">◆ </a></span>Canny()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../df/daa/classcv_1_1GMat.html">GMat</a> cv::gapi::Canny </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../df/daa/classcv_1_1GMat.html">GMat</a> &amp; </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>threshold1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>threshold2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>apertureSize</em> = <code>3</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>L2gradient</em> = <code>false</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d4/d75/gapi_2include_2opencv2_2gapi_2imgproc_8hpp.html">opencv2/gapi/imgproc.hpp</a>&gt;</code></p>
<p>Finds edges in an image using the Canny algorithm. </p>
<p>The function finds edges in the input image and marks them in the output map edges using the Canny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The largest value is used to find initial segments of strong edges. See <a href="http://en.wikipedia.org/wiki/Canny_edge_detector">http://en.wikipedia.org/wiki/Canny_edge_detector</a></p>
<dl class="section note"><dt>Note</dt><dd>Function textual ID is "org.opencv.imgproc.feature.canny"</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td>8-bit input image. </td></tr>
    <tr><td class="paramname">threshold1</td><td>first threshold for the hysteresis procedure. </td></tr>
    <tr><td class="paramname">threshold2</td><td>second threshold for the hysteresis procedure. </td></tr>
    <tr><td class="paramname">apertureSize</td><td>aperture size for the Sobel operator. </td></tr>
    <tr><td class="paramname">L2gradient</td><td>a flag, indicating whether a more accurate \(L_2\) norm \(=\sqrt{(dI/dx)^2 + (dI/dy)^2}\) should be used to calculate the image gradient magnitude ( L2gradient=true ), or whether the default \(L_1\) norm \(=|dI/dx|+|dI/dy|\) is enough ( L2gradient=false ). </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="gaae597c644d9cbf4b76a880e2749be223"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaae597c644d9cbf4b76a880e2749be223">◆ </a></span>goodFeaturesToTrack()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d3/d44/classcv_1_1GArray.html">GArray</a>&lt;<a class="el" href="../../dc/d84/group__core__basic.html#ga7d080aa40de011e4410bca63385ffe2a">Point2f</a>&gt; cv::gapi::goodFeaturesToTrack </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../df/daa/classcv_1_1GMat.html">GMat</a> &amp; </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>maxCorners</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>qualityLevel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>minDistance</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp; </td>
          <td class="paramname"><em>mask</em> = <code><a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>blockSize</em> = <code>3</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>useHarrisDetector</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>k</em> = <code>0.04</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.gapi.goodFeaturesToTrack(</td><td class="paramname">image, maxCorners, qualityLevel, minDistance[, mask[, blockSize[, useHarrisDetector[, k]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d4/d75/gapi_2include_2opencv2_2gapi_2imgproc_8hpp.html">opencv2/gapi/imgproc.hpp</a>&gt;</code></p>
<p>Determines strong corners on an image. </p>
<p>The function finds the most prominent corners in the image or in the specified image region, as described in <a class="el" href="../../d0/de3/citelist.html#CITEREF_Shi94">[223]</a></p>
<ul>
<li>Function calculates the corner quality measure at every source image pixel using the <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga3dbce297c1feb859ee36707e1003e0a8" title="Calculates the minimal eigenvalue of gradient matrices for corner detection. ">cornerMinEigenVal</a> or <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gac1fc3598018010880e370e2f709b4345" title="Harris corner detector. ">cornerHarris</a> .</li>
<li>Function performs a non-maximum suppression (the local maximums in <em>3 x 3</em> neighborhood are retained).</li>
<li>The corners with the minimal eigenvalue less than \(\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)\) are rejected.</li>
<li>The remaining corners are sorted by the quality measure in the descending order.</li>
<li>Function throws away each corner for which there is a stronger corner at a distance less than maxDistance.</li>
</ul>
<p>The function can be used to initialize a point-based tracker of an object.</p>
<dl class="section note"><dt>Note</dt><dd><ul>
<li>If the function is called with different values A and B of the parameter qualityLevel , and A &gt; B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector with qualityLevel=B .</li>
<li>Function textual ID is "org.opencv.imgproc.feature.goodFeaturesToTrack"</li>
</ul>
</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td>Input 8-bit or floating-point 32-bit, single-channel image. </td></tr>
    <tr><td class="paramname">maxCorners</td><td>Maximum number of corners to return. If there are more corners than are found, the strongest of them is returned. <code>maxCorners &lt;= 0</code> implies that no limit on the maximum is set and all detected corners are returned. </td></tr>
    <tr><td class="paramname">qualityLevel</td><td>Parameter characterizing the minimal accepted quality of image corners. The parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue (see <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga3dbce297c1feb859ee36707e1003e0a8" title="Calculates the minimal eigenvalue of gradient matrices for corner detection. ">cornerMinEigenVal</a> ) or the Harris function response (see <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gac1fc3598018010880e370e2f709b4345" title="Harris corner detector. ">cornerHarris</a> ). The corners with the quality measure less than the product are rejected. For example, if the best corner has the quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure less than 15 are rejected. </td></tr>
    <tr><td class="paramname">minDistance</td><td>Minimum possible Euclidean distance between the returned corners. </td></tr>
    <tr><td class="paramname">mask</td><td>Optional region of interest. If the image is not empty (it needs to have the type CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected. </td></tr>
    <tr><td class="paramname">blockSize</td><td>Size of an average block for computing a derivative covariation matrix over each pixel neighborhood. See cornerEigenValsAndVecs . </td></tr>
    <tr><td class="paramname">useHarrisDetector</td><td>Parameter indicating whether to use a Harris detector (see <a class="el" href="../../dd/d1a/group__imgproc__feature.html#gac1fc3598018010880e370e2f709b4345" title="Harris corner detector. ">cornerHarris</a>) or <a class="el" href="../../dd/d1a/group__imgproc__feature.html#ga3dbce297c1feb859ee36707e1003e0a8" title="Calculates the minimal eigenvalue of gradient matrices for corner detection. ">cornerMinEigenVal</a>. </td></tr>
    <tr><td class="paramname">k</td><td>Free parameter of the Harris detector.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>vector of detected corners. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:41 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
